#!/usr/bin/env bash

set -e

project_path=$(cd `dirname $0`; pwd;)
source "${project_path}/1_AutoArchive/ssh_source.sh"
cd $project_path || exit
echoRed '当前路径:'$project_path

# echoRed "输入更新pod库名称(多个以空格分割，区分大小写)"
# read name
# echoRed "更新库:$name"

# 输入更新pod库名称(多个以空格分割，区分大小写)
# name=YXKitOC

# OLD_IFS="$IFS" 
# IFS=" " 
# arr=($name) 
# IFS="$OLD_IFS" 
# for s in ${arr[@]} 
# do 
#     rows=$(sed -n "/$s/=" Podfile)

# 	arr2=($rows) 
# 	for row in ${arr2[@]} 
# 	do 
# 		sed -i "" "${row}s/^/#/" Podfile
# 	done
# done

# pod install

# OLD_IFS="$IFS" 
# IFS="," 
# arr=($name) 
# IFS="$OLD_IFS" 
# for s in ${arr[@]} 
# do 
#     row=$(sed -n "/$s/=" Podfile)
#     arr2=($rows) 
# 	for row in ${arr2[@]} 
# 	do 
# 		sed -i "" "${row}s/^#//" Podfile
# 	done
# done

pod install

echoRed "已更新！"
